package blog.modelo;

// Generated Oct 24, 2014 1:54:18 PM by Hibernate Tools 4.3.1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * BlogUser generated by hbm2java
 */
@Entity
@Table(name = "blog_user", uniqueConstraints = @UniqueConstraint(columnNames = "email"))
public class BlogUser implements java.io.Serializable {

	private Integer id;
	private String name;
	private String email;
	private String website;
	private Set<BlogComment> blogComments = new HashSet<BlogComment>(0);

	public BlogUser() {
	}

	public BlogUser(String name, String email, String website,
			Set<BlogComment> blogComments) {
		this.name = name;
		this.email = email;
		this.website = website;
		this.blogComments = blogComments;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "email", unique = true, length = 45)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "website", length = 45)
	public String getWebsite() {
		return this.website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "blogUser")
	public Set<BlogComment> getBlogComments() {
		return this.blogComments;
	}

	public void setBlogComments(Set<BlogComment> blogComments) {
		this.blogComments = blogComments;
	}

}
